package java925;

import java.util.Arrays;

//3、静态初始化一维数组{10,20,11,35,6,89}，进行冒泡排序
public class Test3 {
    public static void main(String[] args) {
        int[] a = {10, 20, 11, 35, 6, 89};
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a.length - 1 - i; j++) {
                int temp = 0;
                if (a[j] > a[j + 1]) {
                    temp = a[j];
                    a[j] = a[j + 1];
                    a[j + 1] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(a));
    }
}
